﻿package {
	import flash.display.*;
	public class SceneData extends Sprite {
		private static  const UNIT:uint = 30;
		private static  const WIDTH:uint = 15;
		private static  const HEIGHT:uint = 17;
		private var array:Array = new Array();

		private static  const WALL_DATA:Array = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,];

		public function SceneData() {
			
			init();
		}
		private function init():void {
			setWall();
		}
		private function setWall():void {
			
			var row:uint;
			var col:uint;

			for (var i:uint=0; i<WALL_DATA.length; i++) {
				row = int(i/WIDTH);
				col = i - row*WIDTH;
				switch (WALL_DATA[i]) {
					case 1 :
						var brick:Brick = new Brick();
						brick.width = 30;
						brick.height = 30;
						brick.x = (col)*30;
						brick.y = (row)*30;
						addChild(brick);
						break;
					case 0 :
						break;
					
				}
			}
		}
	}
}